package com.example.block_chain.RabbitMQ;

import com.example.block_chain.domain.pbft.VoteInfo;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/*
 *@description: 消息发送
 *@author: hisen
 *@Time: 2023/11/22  21:03
 */
@Component
public class Producer {
    @Resource
    AmqpTemplate amqpTemplate;

    public void sendMessage(VoteInfo voteInfo) {
        amqpTemplate.convertAndSend("schoolAExchange", "", voteInfo);
    }
}
